﻿<!DOCTYPE html>
<html>

<head>
  <title>发动机总体事业部总看板</title>
  <link href="../styles/bootstrap.min.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="../Scripts/jquery-1.11.2.min.js"></script>
  <style type="text/css">
    body,
    table,
    td,
    tr,
    th,
    ul,
    li,
    div,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      margin: 0;
      padding: 0;
    }

    body {
      font-family: 微软雅黑;
      font-size: 14px;
      padding: 0 10px;
      background-image: url(../images/top.jpg)
    }

    #pageList ul {
      margin-top: 10px;
      list-style: none;
      height: 50px;
      overflow: hidden;
      position: absolute;
      top: 0px;
      left: 120px;
    }

    #pageList ul li {
      float: left;
      padding: 0px 5px;
      border: 1px solid #fff;
      margin: 4px 5px;
      color: #fff;
      font-size: 20px;
      font-weight: bold;
      height: 30px;
      line-height: 30px;
      cursor: pointer;
    }

    #pageList ul li:hover {
      background-color: #009688;
    }

    #pageList ul li.select {
      background-color: #009688;
    }

    #btn_autoToggle {
      position: absolute;
      top: 14px;
      left: 10px;
      background: #1E9FFF;
    }
  </style>
</head>

<body>
  <div id="pageList">
    <button type="button" id="btn_autoToggle" class="btn btn-info"
      style="height:32px;font-weight:bolder;font-size:20px;">开启切换</button>
    <ul>
      <li id="zjh" class="select">周计划看板</li>
      <li id="cy">计划差异看板</li>
      <li id="sczb">生产准备看板</li>
      <li id="scjd">生产进度看板</li>
      <li id="gs">工时统计看板</li>
      <li id="wtsb">问题上报看板</li>
      <li id="kh">管理考核看板</li>
      <li id="fj">排故返件看板</li>
      <li id="ydzkb">AEOS看板</li>
    </ul>
  </div>

  <script type="text/javascript">
    $(function () {
      var search = window.parent.window.location.search;
      var count = $("#pageList").find("li").length;
      var interval = null;

      function cancleSelect() {
        $("#pageList ul li").each(function () {
          $(this).removeClass("select");
        });
      };

      $("#pageList ul li").each(function () {
        $(this).click(function () {
          switch ($(this).text()) {
            case "周计划看板":
              window.parent.window.document.getElementById("bottom").contentWindow.location.href = "ZSWeekPlanInfoLookBoard.html" + search;
              break;
            case "生产准备看板":
              window.parent.window.document.getElementById("bottom").contentWindow.location.href = "ZSWorkPrepareLookBoard.html" + search;
              break;
            case "生产进度看板":
              window.parent.window.document.getElementById("bottom").contentWindow.location.href = "ZSWorkingProcessLookBoard.html" + search;
              break;
            case "工时统计看板":
              window.parent.window.document.getElementById("bottom").contentWindow.location.href = "ZSWorkTimeInfoLookBoard.html" + search;
              break;
            case "问题上报看板":
              window.parent.window.document.getElementById("bottom").contentWindow.location.href = "ZSProblemLookBoard.html" + search;
              break;
            case "管理考核看板":
              window.parent.window.document.getElementById("bottom").contentWindow.location.href = "ZSKaoHeLookBoard.html" + search;
              break;
            case "排故返件看板":
              window.parent.window.document.getElementById("bottom").contentWindow.location.href = "ZSDealFaultBillDashBoard.html" + search;
              break;
            case "AEOS看板":
              window.parent.window.document.getElementById("bottom").contentWindow.location.href = "ZSAEOSLookBoard.html" + search;
              break;
            case "计划差异看板":
              window.parent.window.document.getElementById("bottom").contentWindow.location.href = "ZSXinJiStepPlanLookBoard.html" + search;
              break;
          }
          cancleSelect();
          $(this).addClass("select");
        });
      });

      $("#zjh").click();

      $("#btn_autoToggle").click(function () {
        if ($(this).html() === "开启切换") {
          $(this).html("关闭切换");
          var currentIndex = $("#pageList ul .select").index();
          if (currentIndex === (count - 1)) {
            $("#pageList ul").find("li").eq(0).click()
          } else {
            $("#pageList ul").find("li").eq(currentIndex + 1).click()
          };
          startToggle();
        } else {
          $(this).html("开启切换");
          endToggle();
        }
      });

      function startToggle() {
        interval = setInterval(function () {
          var currentIndex = $("#pageList ul .select").index();
          if (currentIndex === (count - 1)) {
            $("#pageList ul").find("li").eq(0).click()
          } else {
            $("#pageList ul").find("li").eq(currentIndex + 1).click()
          }
        }, 10000);
      };

      function endToggle() {
        clearInterval(interval);
      };
    });

  </script>
</body>

</html>